<template>
	<view class="w">
		<view class="card" v-for="(v, i) in list" :key="i" @click="fn(v.videoId, v.title)">
			{{ v.title }}
		</view>
	</view>
</template>

<script setup>
import { onLoad } from '@dcloudio/uni-app'
import { ref } from 'vue';
const list = ref([])
onLoad(({ id, title }) => {
	for (let i = 0; i < 5; i++) {
		list.value.push({
			title: title + '——' + i,
			videoId: i,
			imgUrl: ''
		})
	}
	uni.setNavigationBarTitle({ title });
})


const fn = (id, title) => {
	console.log(id);
	uni.navigateTo({ url: `/pages/class/subject/videos/index?id=${id}&title=${title}` })
}
</script>

<style lang="less" scoped>
.card {
	height: 210rpx;
	background-image: linear-gradient(rgb(116, 253, 230), rgb(121, 141, 255));
	border-radius: 14rpx 14rpx 14rpx 14rpx;
	margin-bottom: 20rpx;
}

.w {
	padding-top: 100rpx;
}
</style>